package com.lm.customer.controller;

import com.lm.dubboapi.model.Product;
import com.lm.dubboapi.service.ProductService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @DubboReference
    private ProductService productService;

    @GetMapping("/create")
    public String createOrder() {
        Product product = productService.getProduct(1L);
        return "下单成功，商品：" + product.getName();
    }
}
